<template>
    <Base title="告警实时通知">
        <div class="pageMain">
            <div class="bottomBox">
                <div class="itemBox">
                    <div class="itemNum red">0</div>
                    <div class="itemText red">紧急</div>
                </div>
                <div class="itemBox">
                    <div class="itemNum yellow">10</div>
                    <div class="itemText yellow">重要</div>
                </div>
                <div class="itemBox">
                    <div class="itemNum green">0</div>
                    <div class="itemText green">一般</div>
                </div>
                <div class="itemBox">
                    <div class="itemNum blue">0</div>
                    <div class="itemText blue">提示</div>
                </div>
            </div>
            <div class="noticeList">
                <div class="notiveItemBox" v-for="(item, index) in list" :key="index" :class="classList[item.type]">
                    <div class="typeText" :class="shadowList[item.type]">{{typeText[item.type]}}</div>
                    <div class="contengText">{{item.content}}</div>
                    <div class="timeText">{{item.time}}</div>
                </div>
            </div>
        </div>
    </Base>
  </template>
  
  <script setup>
    import Base from '@/components/base/base.vue'
    const list = [
        {
            type: '1',
            content: '编号0033杆塔附近有火情，请及时编号0033杆塔附近有火情，请及时',
            time: '2023-11-18  11:27'
        },
        {
            type: '2',
            content: '编号0033杆塔附近有火情，请及时编号0033杆塔附近有火情，请及时',
            time: '2023-11-18  11:27'
        },
        {
            type: '3',
            content: '编号0033杆塔附近有火情，请及时编号0033杆塔附近有火情，请及时',
            time: '2023-11-18  11:27'
        },
        {
            type: '4',
            content: '编号0033杆塔附近有火情，请及时...',
            time: '2023-11-18  11:27'
        },
        {
            type: '1',
            content: '编号0033杆塔附近有火情，请及时...',
            time: '2023-11-18  11:27'
        },
        {
            type: '2',
            content: '编号0033杆塔附近有火情，请及时...',
            time: '2023-11-18  11:27'
        },
    ]
    const classList = ['', 'redBack', 'yellowBack', 'greenBack', 'blueBack']
    const typeText = ['', '紧急', '重要', '一般', '提示']
    const shadowList = ['', 'redShadow', 'yellowShadow', 'blueShadow', 'greenShadow']
  </script>
  
  <style lang="scss" scoped>
  .pageMain {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        .bottomBox {
            width: 80%;
            margin-top: 30px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .itemBox {
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                .itemText {
                    font-size: 12px;
                    margin-top: 10px;
                }
                .itemNum {
                    font-size: 14px;
                    font-weight: bold;
                }
            }
        }
        .red {
            color: #F10142;
        }
        .orange {
            color: #FF4639;
        }
        .yellow {
            color: #FAC038;
        }
        .blue {
            color: #00B9FF;
        }
        .green {
            color: #00FFA8;
        }
        .noticeList {
            overflow-y: scroll;
            width: calc(100% - 40px);
            height: 300px;
        }
        .noticeList::-webkit-scrollbar-thumb {
            display: none;
        }
        .noticeList::-webkit-scrollbar{
            display: none;
        }
        .notiveItemBox {
            width: 100%;
            height: 44px;
            display: flex;
            align-items: center;
            border-radius: 4px 4px 4px 4px;
            margin-bottom: 20px;
            padding: 0 12px;
            box-sizing: border-box;
            color: #fff;
            position: relative;
            .typeText {
                width: 34px;
                height: 18px;
                border-radius: 2px 2px 2px 2px;
                font-size: 12px;
                font-weight: bold;
                display: flex;
                justify-content: center;
                align-items: center;
                margin-right: 10px;
            }
            .contengText {
                width: 58%;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 12px;
            }
            .timeText {
                margin-left: 10px;
                font-size: 12px;
            }
        }
        .redBack::before,
        .redBack::after {
            position: absolute;
            bottom: -11px;
            left: calc(2%);
            display: block;
            font-size: 0;
            line-height: 0;
            border-color: #ff0000 transparent transparent;
            border-style: solid;
            border-width: 5px;
            content: "";
        }

        .redBack::after {
            bottom: -10px;
            border-color: #210c19 transparent transparent;
        }

        .yellowBack::before,
        .yellowBack::after {
            position: absolute;
            bottom: -11px;
            left: calc(2%);
            display: block;
            font-size: 0;
            line-height: 0;
            border-color: #FFEE00 transparent transparent;
            border-style: solid;
            border-width: 5px;
            content: "";
        }

        .yellowBack::after {
            bottom: -10px;
            border-color: #210c19 transparent transparent;
        }

        .greenBack::before,
        .greenBack::after {
            position: absolute;
            bottom: -11px;
            left: calc(2%);
            display: block;
            font-size: 0;
            line-height: 0;
            border-color: #00FFA8 transparent transparent;
            border-style: solid;
            border-width: 5px;
            content: "";
        }

        .greenBack::after {
            bottom: -10px;
            border-color: #210c19 transparent transparent;
        }

        .blueBack::before,
        .blueBack::after {
            position: absolute;
            bottom: -11px;
            left: calc(2%);
            display: block;
            font-size: 0;
            line-height: 0;
            border-color: #00B9FF transparent transparent;
            border-style: solid;
            border-width: 5px;
            content: "";
        }

        .blueBack::after {
            bottom: -10px;
            border-color: #210c19 transparent transparent;
        }
        
        .redBack {
            background: rgba(255, 0, 0, 0.1);
            border: 1px solid #FF0000;
        }
        .yellowBack {
            background: rgba(255, 238, 0, 0.1);
            border: 1px solid #FFEE00;
        }
        .greenBack {
            background: rgba(0, 255, 168, 0.1);
            border: 1px solid #00FFA8;
        }
        .blueBack {
            background: rgba(0, 185, 255, 0.1);
            border: 1px solid #00B9FF;
        }
        .redShadow {
            box-shadow: inset 0px 0px 8px 1px #FF0000;
        }
        .yellowShadow {
            box-shadow: inset 0px 0px 8px 1px #FFEE00;
        }
        .blueShadow {
            box-shadow: inset 0px 0px 8px 1px #00FFA8;
        }
        .greenShadow {
            box-shadow: inset 0px 0px 8px 1px #00B9FF;
        }
        
  }
  
  </style>
  